import { createRouter, createWebHistory } from 'vue-router'
import Layout from '../layout/Layout.vue'
import Slay from '../layout/Slay.vue'
import Personal from "@/views/Personal.vue";
import Student from "@/views/Student.vue";
import Register from "@/views/Register.vue";
import Login from "@/views/Login.vue";
import User from "@/views/User.vue";
import Rule from "@/views/Rule.vue";
import Price from "@/views/Price.vue";
import Srule from "@/views/Srule.vue";
import Sprice from "@/views/Sprice.vue";
import Spersonal from "@/views/Spersonal.vue";
import Srules from "@/views/Srules.vue";

const routes = [
  {
    path: '/',
    name: 'Layout',
    component: Layout,
    redirect:"/user",
    children:[
      {
        path:'/user',
        name:'User',
        component: User
      },
      {
        path: '/rule',
        name: 'Rule',
        component: Rule
      },
      {
        path:'/price',
        name:'Price',
        component: Price
      },
      {
        path: '/personal',
        name: 'Personal',
        component: Personal
      },
      {
        path:'/srules',
        name:'Srules',
        component: Srules
      },

    ]
  },
  {
    path: '/slay',
    name: 'Slay',
    component: Slay,
    redirect:"/student",
    children:[
      {
        path: '/student',
        name: 'Student',
        component: Student
      },
      {
        path: '/srule',
        name: 'Srule',
        component: Srule
      },
      {
        path:'/sprice',
        name:'Sprice',
        component: Sprice
      },
      {
        path: '/spersonal',
        name: 'Spersonal',
        component: Spersonal
      },

    ]
  },
  {
    path: '/login',
    name: 'Login',
    component: Login
  },
  {
    path: '/register',
    name: 'Register',
    component: Register
  },



]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
